//
//  CopyToPhoneViewController.m
//  Tools
//
//  Created by zhangqianchu on 2018/6/3.
//  Copyright © 2018年 zhangqianchu. All rights reserved.
//

#import "RecordViewController.h"

@interface RecordViewController ()

@end

@implementation RecordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do view setup here.
    
    self.title = @"QTools";
}
- (IBAction)copyToPhone:(id)sender {
//    NSString *source = _sourceTextField.stringValue;
//    NSString *des = _desTextField.stringValue;
//    copyToPhone([source cStringUsingEncoding:NSASCIIStringEncoding],
//             [des cStringUsingEncoding:NSASCIIStringEncoding]);
//    获取当前路径
//    char buf[0] = {0};
//    uint32_t size = 0;
//    _NSGetExecutablePath(buf,&size);
//    char* path = (char*)malloc(size+1);
//    path[size] = 0;
//    _NSGetExecutablePath(path,&size);
//    printf("%s",path);
    NSString *time = _inputTextField.stringValue;
    NSString *resources = NSBundle.mainBundle.resourcePath;
    NSString *adb = @"/adb ";
    NSString *result = [resources stringByAppendingString:adb];
    
    NSString *home = NSHomeDirectory();
//    printf("home:%s", [home UTF8String]);
    
    _quickRecord([home UTF8String], [time cStringUsingEncoding:NSASCIIStringEncoding]);
    
}

@end
